#include "cmconstants.h"
#include <ostream>

#pragma once


/** This clas represents a coordinate in a 2-d space, with a row and a column. */
class Coordinate
{
public:
	int row;
	int col;

	void print(void) const;
	
	/** Returns true if the given coordinate has the same row and col as this object. */
	bool isEqual (const Coordinate& other) const {return (this->row == other.row && this->col == other.col);}
	
	/** Returns false if the given coordinate has the same row and col as this object. */
	bool isNotEqual (const Coordinate& other) const {return (this->row != other.row || this->col != other.col);}
	
	/** Returns the relative location of the given coordinate to this object. */
	relativeLocation whichSideIs(const Coordinate& coo) const;

	Coordinate& operator= (const Coordinate& other);
	//Coordinate& operator== (const Coordinate& other);
	//Coordinate& operator!= (const Coordinate& other);
	Coordinate() {row=-1; col=-1;}
	Coordinate(int r, int c) {row=r; col=c;}
	Coordinate(const Coordinate& other) {row=other.row; col=other.col;}
	~Coordinate() {row=0; col=0;}
		
};

std::ostream& operator<< (std::ostream& stream, const Coordinate& coo);